/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.aksw.treelearning.tree;

import org.aksw.treelearning.data.Mapping;

/**
 *
 * @author ngonga
 */
public class Condition {

    public String sourceProperty;
    public String targetProperty;
    public double threshold;
    public int q;
    public double fMeasure;
    public Mapping mapping;
    
    public Condition(String property, double threshold, int q) {
        this.sourceProperty = property;
        this.targetProperty = property;
        this.threshold = threshold;
        this.q = q;
        fMeasure = -1;
        mapping = null;
    }
    
    public Condition(String sourceProperty, String targetProperty, double threshold, int q) {
        this.sourceProperty = sourceProperty;
        this.targetProperty = targetProperty;
        this.threshold = threshold;
        this.q = q;
        fMeasure = -1;
    }

    public String toString() {
        if (fMeasure >= 0f) {
            return "(" + sourceProperty + ", " + targetProperty + ", " + q + ", " + threshold + ") -> " + fMeasure;
        } else {
            return "(" + sourceProperty + ", " + targetProperty + ", " + q + ", " + threshold + ")";
        }
    }
}
